<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			window.onload=function(){
				//获取count
				var count=document.getElementById("count");
				//使count内容自动切换
				// count.innerHTML=9;
				// count.innerHTML=8;
			// 	for(var i=10;i>0;i--){
			// 		count.innerHTML=i;
				
			// }
			//定时调用
			var num=10;
			var time=setInterval(function() {
				num2=count.innerHTML=num--;
				if(num2==0){
					clearInterval(time);
					location.href="https://www.baidu.com";//跳转百度
				}
				
				
			},1000);
			};
			//clearInterval()关闭定时器
			
		</script>
	</head>
	<body>
		<h1 id="count">倒计时开始</h1>
	</body>
</html>